﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LitJson;

namespace SkillSystem
{
    public  class SkillItem
    {
        public SkillItemData CurSkillItemData { get; private set; }

        public SkillItemState State;

        public Dictionary<SkillItemLinkerType, ISkillItemLinker> Linkers = new Dictionary<SkillItemLinkerType, ISkillItemLinker>();

        public JsonData DamageArgs;

        public SkillItem(SkillItemData curSkillItemData)
        {
            CurSkillItemData = curSkillItemData;
            for (int i = 0; i < CurSkillItemData.SkillLinkerType.Count; i++)
            {
                SkillItemLinkerType type = (SkillItemLinkerType)CurSkillItemData.SkillLinkerType[i];
                Linkers.Add(type, SkillSystemFacade.Inst.GetItemLinker(type));
            }
            DamageArgs =  JsonMapper.ToObject(curSkillItemData.DamageResultArgs);
        }

        public void Reset()
        {

        }
    }
}
